package com.eazy.lkv2.web.controller.mobile;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.eazy.lkv2.web.controller.BaseController;
import com.eazy.lkv2.web.service.traffic.CityService;

/**
 * 
 * @author jzx
 * 
 * 2016-08-17 16:11:37 星期三
 * 
 * 手机web端
 * 
 * 访问链接  http://localhost:8081/mobile/index.html
 * 项目部署方式参考部署文档
 */
@Controller
@RequestMapping("/mobile")
public class MobileIndexController extends BaseController<Object, Integer> {

	@Autowired
	private CityService cityService;
	
	/**
	 * 手机移动端入口
	 */
	@RequestMapping(value = "index.html", method = RequestMethod.GET)
	public String index() {
		return getDefault("index");
	}
	
	/**
	 * 帮助页面入口
	 */
	@RequestMapping(value = "help.html", method = RequestMethod.GET)
	public String help() {
		return getDefault("help/help");
	}
	
	/**
	 * 我的订单入口
	 */
	@RequestMapping(value = "login.html", method = RequestMethod.GET)
	public String order() {
		return getDefault("order/login");
	}
	
	/**
	 * 选择城市功能
	 */
	@RequestMapping(value = "citylist.html", method = RequestMethod.GET)
	public String cityList(Model model) {
		List<Map<String, Object>> data = cityService.select();
		model.addAttribute("data", data);
		return getDefault("city/citylist");
	}
}
